package com.yungu.swift.order.service;

import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.order.model.dto.OrderCallHistoryDto;
import com.yungu.swift.order.model.dto.OrderDto;
import com.yungu.swift.order.model.param.*;
import com.yungu.swift.order.model.vo.*;

import java.util.List;
import java.util.Map;

/**
 * 跨城/小件订单业务
 *
 * @author : cuixiuyin
 * @date : 2019/12/5
 */
public interface OrderJoinService {

    /**
     * 跨城小件一口价KEY
     */
    String PARCEL_FIXED_PRICE_KEY = "fixedPrice";


    /**
     * 跨城拼车：查询司机跨城拼车订单
     *
     * @param params
     * @return
     */
    ResponseData<List<OrderDto>> getCompleteOrderByDate(Map<String, Object> params);

    /**
     * 跨城拼车：去接乘客（行程开始）
     *
     * @param orderUuid
     * @return
     */
    ResponseData<JsonOrderDetailVo> startJoinOrder(String orderUuid);

    /**
     * 跨城拼车：行程结束
     *
     * @param orderUuid
     * @return
     */
    ResponseData<JsonOrderDetailVo> completeJoinOrder(String orderUuid);

    /**
     * 跨城拼车：司机订单（子订单）列表
     *
     * @param demandParam
     * @return
     */
    ResponseData<PageList<JsonOrderDetailVo>> joinPageList(ApiJoinListParam demandParam);

    /**
     * 跨城拼车：关闭订单
     *
     * @param joinOrderParam
     * @return
     */
    ResponseData<Boolean> closeJoinOrder(JoinOrderParam joinOrderParam);

    /**
     * 跨城拼车：订单预约
     */
    ResponseData<Boolean> subscribeJoinOrder(String orderUuid, String userUuid);

    /**
     * 跨城拼车：关闭订单（外部调用-批量）
     */
    ResponseData<Boolean> closeJoinOrder(String appid);

    /**
     * 跨城拼车：出发前推送提醒
     */
    ResponseData<Boolean> deparOrderPushMsg(String appid);

    /**
     * 获取完整拼车订单详情接口（含关联订单）
     */
    ResponseData<Map<String, Object>> getInfoRelatedOrder(String uuid);

    /**
     * 跨城订单：接收订单来电
     */
    ResponseData<OrderCallHistoryDto> recvJoinOrderCall(String phoneNumber, String appid);

    /**
     * 创建跨城订单
     */
    ResponseData<Map<String, Object>> createCrosstownOrder(JoinOrderParam joinOrderParam);

    /**
     * 获取跨城小件收件码
     */
    ResponseData<List<Map<String, Object>>> getReceiptCode(JoinOrderParam joinOrderParam);

    /**
     * 确认收件码
     */
    ResponseData<Boolean> confirmReceiptCode(JoinOrderParam joinOrderParam);

    /**
     * 获取跨城小件标签接口
     */
    ResponseData<Map<String, Object>> getParcelTag(JoinOrderParam joinOrderParam);

    /**
     * 跨城订单订单顺序更新
     */
    ResponseData<Boolean> orderSequenceChange(List<CrosstownOrderParam> paramList);

    /**
     * 跨城订单集合获取
     *
     * @param type 订单数据 0：全部 1：本日 2：本周 3：本月
     */
    ResponseData<PageList<CrosstownOrderVo>> crosstownOrderListInfo(CrosstownOrderParam crosstownOrderParam, Integer type);

    /**
     * 跨城订单获取子单底下的所有订单详细信息
     */
    ResponseData<CrosstownDriverOrderDetailVo> crosstownOrderListDetail(CrosstownOrderParam crosstownOrderParam);

    /**
     * 跨城订单订单状态更新
     */
    ResponseData<Map<String, Object>> crosstownOrderStateChange(CrosstownOrderParam crosstownOrderParam);

    /**
     * 跨城订单池信息
     */
    ResponseData<PageList<CrosstownOrderPoolInfoVo>> crosstownOrderPoolInfo(CrosstownOrderParam crosstownOrderParam);

    /**
     * 跨城订单池数量
     */
    ResponseData<Map<String, Object>> crosstownOrderPoolCount(CrosstownOrderParam crosstownOrderParam);

    /**
     * 合并派单校验
     */
    ResponseData<Map<String, Object>> mergeAssignVerify(MergeAssignParam mergeAssignParam);

    /**
     * 获取退款订单列表
     */
    ResponseData<List<OrderDto>> queryRefundList(Map<String, Object> params);

    /**
     * 跨城修改派单前的订单信息
     */
    ResponseData<Boolean> crosstownEditOrderInfo(AdminOrderEditParam adminOrderEditParam);

    /**
     * 跨城修改派单后的订单信息
     */
    ResponseData<Boolean> editAssignOrder(AdminOrderEditParam adminOrderEditParam);

    /**
     * 跨城派单弹窗拉取
     */
    ResponseData<List<CrosstownMergeAssignInfoVo>> crosstownAssignInfo(MergeAssignParam mergeAssignParam);

    /**
     * 合并派单打开窗口预处理
     */
    ResponseData<Boolean> mergeAssignPreHandle(MergeAssignParam mergeAssignParam);

    /**
     * 获取跨城订单详情
     */
    ResponseData<ApiCrosstownOrderInfoVo> getCrosstownOrderInfo(String orderUuid);

    /**
     * 获取进行中订单
     */
    ResponseData<Map<String, Object>> getCrosstownUnderwayOrder(String driverUuid);

    /**
     * 获取乘客跨城首页订单
     */
    ResponseData<List<CrosstownHomeOrderInfoVo>> getCrosstownHomeOrderInfo(Map<String, Object> params);

    /**
     * 跨城拼车行程任务列表
     *
     * @param crosstownOrderParam
     * @return
     */
    ResponseData<List<CrosstownOrderTaskInfoVo>> taskList(CrosstownOrderParam crosstownOrderParam);
}
